package com.sdleyou.treepro.common.model.convert;

import com.sdleyou.treepro.common.model.dao.CompanyDO;
import com.sdleyou.treepro.common.model.vo.CompanyRankVO;

public class CompanyDO2CompanyRankVOConverter {

    public static CompanyRankVO convert(CompanyDO companyDO, String companyId) {
        CompanyRankVO companyRankVO = new CompanyRankVO();
        companyRankVO.setCompanyId(companyDO.getCompanyId());
        companyRankVO.setCompanyName(companyDO.getCompanyName());
        companyRankVO.setFace(companyDO.getCompanyIcon());
        companyRankVO.setTreeSum(companyDO.getTreeCount());
        if (companyDO.getCompanyId().equals(companyId)) {
            companyRankVO.setIsMe(true);
        } else {
            companyRankVO.setIsMe(false);
        }
        return companyRankVO;
    }
}
